<title>Clear Flat Signin Form Widget Template | Home </title>
<!-- Custom Theme files -->
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/style.css" media="all">
<!-- Custom Theme files -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta name="keywords" content="Login form web template, Sign up Web Templates, Flat Web Templates, Login signup Responsive web template, Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />


<style> 
body{ text-align:center} 
.div1{ margin:0 0 0 0; width:300px; height:100px; border:0px solid #F00} 
.div2{ margin:0 0 0 0; width:300px; height:1100px; border:0px solid #F00} 
/* css注释：为了观察效果设置宽度 边框 高度等样式 */ 
</style> 


<?php
/* session_start();
echo $_SESSION[$model->username];
var_dump($_SESSION[$model->username]); */
?>
<?php 
/* session_start();
if(!empty($_SESSION[$model->username]))//你已经赋值的ID
    echo '<a href="#">进入个人中心</a> | <a href="logout.php">注销</a>';//登陆后的处理
else
    echo '<a href="login.php">您还未登陆,点击登陆</a>';//未登陆的处理 */
?>

<?php 
    $this->widget('bootstrap.widgets.TbMenu', array(
    'type'=>'tabs', // '', 'tabs', 'pills' (or 'list')
    'stacked'=>false, // whether this is a stacked menu
    'items'=>array(
        array('label'=>'Home', 'url'=>'#', 'active'=>true),
        array('label'=>'设置', 'url'=>'#'),
        array('label'=>'创建活动', 'url'=>array(
            'activity', 'usr' => $register_data["username"],
        )),
        ),
    )); 
?>
<?php 
    //var_dump($_GET['post']);
    //var_dump($activity_data);
?>
<h1 style = 'font-size:30px;align:center;color:blue;'>个人信息</h1>
<div class = 'div1'>
<?php $this->widget('bootstrap.widgets.TbDetailView', array(
    'data'=>array('username'=>$register_data["username"], 
                'email'=>$register_data["email"]),
    'attributes'=>array(
        array('name'=>'username', 'label'=>'用户名'),
        array('name'=>'email', 'label'=>'邮箱'),
        ),
    )); 
?>
</div>
<h1 style = 'font-size:30px;align:center;color:blue;'>活动信息</h1>
<div class = 'div2'>
<?php 
    $activity_id = 0;
    $now_time = date('Y-m-d H:i:s',time());
    foreach ($activity_data as $value) {
        $activity_id++;
        if($value['end_time'] <= $now_time)
        {
            $status = '已过期';
        }
        else if (strtotime($value['start_time']) <= strtotime($now_time) && 
                strtotime($value['end_time']) > strtotime($now_time))
        {
            $status = '正在进行';
        }
        else
        {
            $status = '未开始';
        }
?>
<?php $this->widget('bootstrap.widgets.TbDetailView', array(
    'data'=>array('activity_id'=>$activity_id,
                'company_name'=>$value['company_name'], 
                'activity_name'=>$value['activity_name'], 
                'telephone'=>$value['telephone'],
                'start_time'=>$value['start_time'],
                'end_time'=>$value['end_time'],
                'location'=>$value['location'],
                'goods'=>$value['goods'],
                'status'=>$status,
),
    'attributes'=>array(
        array('name'=>'activity_id', 'label'=>'活动序号'),
        array('name'=>'company_name', 'label'=>'公司名称'),
        array('name'=>'activity_name', 'label'=>'活动名称'),
        array('name'=>'telephone', 'label'=>'预留电话'),
        array('name'=>'start_time', 'label'=>'活动开始时间'),
        array('name'=>'end_time', 'label'=>'活动结束时间'),
        array('name'=>'location', 'label'=>'活动地点'),
        array('name'=>'goods', 'label'=>'赠送商品'),
        array('name'=>'status', 'label'=>'活动状态'),
        
        ),
    )); 
?>
</br>
<?php }?>
</div>
